********************************************************************************************
**** DESCRIPTIVE STATISTICS OF HOUSEHOLD CHARACTERISTICS AT BASELINE AND FOLLOW-UP
**** QUANTILE REGRESSION
**** This file generates output tables for group comparison at baseline using quantile 
**** regression.
**** Version: 21/05/2014
********************************************************************************************

********************************************************************************************
**** HOUSEHOLD LEVEL VARIABLES
********************************************************************************************

	* EXPENDITURE AND CONSUMPTION
		cap drop sh_expenditure sh_expenditure_adj
		
		gen sh_expenditure = ln_expenditure
		gen sh_expenditure_adj = ln_expenditure_adj
		label var sh_expenditure "Monthly log expenditure"
		label var sh_expenditure_adj "Monthly log consumption"

			
		qtreattest sh_food sh_clothing sh_school sh_health sh_utilities
		
				esttab using "Outputs/Expenditure treatment differences at different quantiles.tex", f replace compress noobs nonumb nomtitles width(0.8\textwidth) gaps ///
				cells( ///
				"c_1(fmt(3) star pvalue(t_1)) c_25(fmt(3) star pvalue(t_25)) c_5(fmt(3) star pvalue(t_5)) c_75(fmt(3) star pvalue(t_75)) c_9(fmt(3) star pvalue(t_9)) cf_1(fmt(3) star pvalue(tf_1)) cf_25(fmt(3) star pvalue(tf_25)) cf_5(fmt(3) star pvalue(tf_5)) cf_75(fmt(3) star pvalue(tf_75)) cf_9(fmt(3) star pvalue(tf_9))" ///	
				"se_1(fmt(3) par) se_25(fmt(3) par) se_5(fmt(3) par) se_75(fmt(3) par) se_9(fmt(3) par) sef_1(fmt(3) par) sef_25(fmt(3) par) sef_5(fmt(3) par) sef_75(fmt(3) par) sef_9(fmt(3) par)") ///
				label star(* 0.1 ** 0.05 *** 0.01) ///
				stats(N1 N25 N5 N75 N9 NF1 NF25 NF5 NF75 NF9 , layout("@ @ @ @ @ @ @ @ @ @") labels("Observations") fmt(0)) ///
				collabels("10" "25" "50" "75" "90" "10" "25" "50" "75" "90")
						
				
		qtreattest sh_expenditure_adj sh_food_adj sh_clothing_adj sh_school_adj sh_health_adj sh_utilities_adj

				esttab using "Outputs/Consumption treatment differences at different quantiles (baseline).tex", f replace compress noobs nonumb nomtitles width(0.8\textwidth) gaps ///
				cells( ///
				"c_1(fmt(3) star pvalue(t_1)) c_2(fmt(3) star pvalue(t_2)) c_3(fmt(3) star pvalue(t_3)) c_4(fmt(3) star pvalue(t_4)) c_5(fmt(3) star pvalue(t_5)) c_6(fmt(3) star pvalue(t_6)) c_7(fmt(3) star pvalue(t_7)) c_8(fmt(3) star pvalue(t_8)) c_9(fmt(3) star pvalue(t_9))" ///
				"se_1(fmt(3) par) se_2(fmt(3) par) se_3(fmt(3) par) se_4(fmt(3) par) se_5(fmt(3) par) se_6(fmt(3) par) se_7(fmt(3) par) se_8(fmt(3) par) se_9(fmt(3) par)") label star(* 0.1 ** 0.05 *** 0.01) ///
				stats(N1 N2 N3 N4 N5 N6 N7 N8 N9, layout("@ @ @ @ @ @ @ @ @") labels("Observations") fmt(0)) ///
				mgroups("\multicolumn{8}{c}{\textit{Quantile}}", span) ///
				collabels("10" "20" "30" "40" "50" "60" "70" "80" "90") ///
				ti("Difference in consumption and consumption shares by treatment status at different quantiles (baseline)\label{QConsAllBaseline}")
	 
	 			esttab using "Outputs/Consumption treatment differences at different quantiles (follow-up).tex", f replace compress noobs nonumb nomtitles width(0.8\textwidth) gaps ///
				cells( ///
				"cf_1(fmt(3) star pvalue(tf_1)) cf_2(fmt(3) star pvalue(tf_2)) cf_3(fmt(3) star pvalue(tf_3)) cf_4(fmt(3) star pvalue(tf_4)) cf_5(fmt(3) star pvalue(tf_5)) cf_6(fmt(3) star pvalue(tf_6)) cf_7(fmt(3) star pvalue(tf_7)) cf_8(fmt(3) star pvalue(tf_8)) cf_9(fmt(3) star pvalue(tf_9))" ///
				"sef_1(fmt(3) par) sef_2(fmt(3) par) sef_3(fmt(3) par) sef_4(fmt(3) par) sef_5(fmt(3) par) sef_6(fmt(3) par) sef_7(fmt(3) par) sef_8(fmt(3) par) sef_9(fmt(3) par)") label star(* 0.1 ** 0.05 *** 0.01) ///
				stats(N10 N11 N12 N13 N14 N15 N16 N17 N18, layout("@ @ @ @ @ @ @ @ @") labels("Observations") fmt(0)) ///
				mgroups("\multicolumn{8}{c}{\textit{Quantile}}", span) ///
				collabels("10" "20" "30" "40" "50" "60" "70" "80" "90") ///
				ti("Difference in consumption and consumption shares by treatment status at different quantiles (follow-up)\label{QConsAllFollow}") 
	 
		drop sh_expenditure sh_expenditure_adj
	
	
	* FOOD CATEGORIES
	
	
		qtreattest ssh_food_cereal ssh_food_veg ssh_food_meat ssh_food_oil ssh_food_dairy

				esttab using "Outputs/Expenditure treatment differences at different quantiles (food, baseline).tex", f replace compress noobs nonumb nomtitles gaps ///
				cells( ///
				"c_1(fmt(3) star pvalue(t_1)) c_2(fmt(3) star pvalue(t_2)) c_3(fmt(3) star pvalue(t_3)) c_4(fmt(3) star pvalue(t_4)) c_5(fmt(3) star pvalue(t_5)) c_6(fmt(3) star pvalue(t_6)) c_7(fmt(3) star pvalue(t_7)) c_8(fmt(3) star pvalue(t_8)) c_9(fmt(3) star pvalue(t_9))" ///
				"se_1(fmt(3) par) se_2(fmt(3) par) se_3(fmt(3) par) se_4(fmt(3) par) se_5(fmt(3) par) se_6(fmt(3) par) se_7(fmt(3) par) se_8(fmt(3) par) se_9(fmt(3) par)") label star(* 0.1 ** 0.05 *** 0.01) ///
				stats(N1 N2 N3 N4 N5 N6 N7 N8 N9, layout("@ @ @ @ @ @ @ @ @") labels("Observations") fmt(0)) ///
				mgroups("\multicolumn{8}{c}{\textit{Quantile}}", span) ///
				collabels("10" "20" "30" "40" "50" "60" "70" "80" "90") ///
				ti("Difference in food budget shares by treatment status at different quantiles (baseline)\label{QExpFoodBaseline}")
	 
	 			esttab using "Outputs/Expenditure treatment differences at different quantiles (food, follow-up).tex", f replace compress noobs nonumb nomtitles gaps ///
				cells( ///
				"cf_1(fmt(3) star pvalue(tf_1)) cf_2(fmt(3) star pvalue(tf_2)) cf_3(fmt(3) star pvalue(tf_3)) cf_4(fmt(3) star pvalue(tf_4)) cf_5(fmt(3) star pvalue(tf_5)) cf_6(fmt(3) star pvalue(tf_6)) cf_7(fmt(3) star pvalue(tf_7)) cf_8(fmt(3) star pvalue(tf_8)) cf_9(fmt(3) star pvalue(tf_9))" ///
				"sef_1(fmt(3) par) sef_2(fmt(3) par) sef_3(fmt(3) par) sef_4(fmt(3) par) sef_5(fmt(3) par) sef_6(fmt(3) par) sef_7(fmt(3) par) sef_8(fmt(3) par) sef_9(fmt(3) par)") label star(* 0.1 ** 0.05 *** 0.01) ///
				stats(N10 N11 N12 N13 N14 N15 N16 N17 N18, layout("@ @ @ @ @ @ @ @ @") labels("Observations") fmt(0)) ///
				mgroups("\multicolumn{8}{c}{\textit{Quantile}}", span) ///
				collabels("10" "20" "30" "40" "50" "60" "70" "80" "90") ///
				ti("Difference in food budget shares by treatment status at different quantiles (follow-up)\label{QExpFoodFollow}")
				
		qtreattest ssh_food_cereal_adj ssh_food_veg_adj ssh_food_meat_adj ssh_food_oil_adj ssh_food_dairy_adj
		
				esttab using "Outputs/Consumption treatment differences at different quantiles (food, baseline).tex", f replace compress noobs nonumb nomtitles gaps ///
				cells( ///
				"c_1(fmt(3) star pvalue(t_1)) c_2(fmt(3) star pvalue(t_2)) c_3(fmt(3) star pvalue(t_3)) c_4(fmt(3) star pvalue(t_4)) c_5(fmt(3) star pvalue(t_5)) c_6(fmt(3) star pvalue(t_6)) c_7(fmt(3) star pvalue(t_7)) c_8(fmt(3) star pvalue(t_8)) c_9(fmt(3) star pvalue(t_9))" ///
				"se_1(fmt(3) par) se_2(fmt(3) par) se_3(fmt(3) par) se_4(fmt(3) par) se_5(fmt(3) par) se_6(fmt(3) par) se_7(fmt(3) par) se_8(fmt(3) par) se_9(fmt(3) par)") label star(* 0.1 ** 0.05 *** 0.01) ///
				stats(N1 N2 N3 N4 N5 N6 N7 N8 N9, layout("@ @ @ @ @ @ @ @ @") labels("Observations") fmt(0)) ///
				mgroups("\multicolumn{8}{c}{\textit{Quantile}}", span) ///
				collabels("10" "20" "30" "40" "50" "60" "70" "80" "90") ///
				ti("Difference in food consumption shares by treatment status at different quantiles (baseline)\label{QConsFoodBaseline}")
	 
	 			esttab using "Outputs/Consumption treatment differences at different quantiles (food, follow-up).tex", f replace compress noobs nonumb nomtitles gaps ///
				cells( ///
				"cf_1(fmt(3) star pvalue(tf_1)) cf_2(fmt(3) star pvalue(tf_2)) cf_3(fmt(3) star pvalue(tf_3)) cf_4(fmt(3) star pvalue(tf_4)) cf_5(fmt(3) star pvalue(tf_5)) cf_6(fmt(3) star pvalue(tf_6)) cf_7(fmt(3) star pvalue(tf_7)) cf_8(fmt(3) star pvalue(tf_8)) cf_9(fmt(3) star pvalue(tf_9))" ///
				"sef_1(fmt(3) par) sef_2(fmt(3) par) sef_3(fmt(3) par) sef_4(fmt(3) par) sef_5(fmt(3) par) sef_6(fmt(3) par) sef_7(fmt(3) par) sef_8(fmt(3) par) sef_9(fmt(3) par)") label star(* 0.1 ** 0.05 *** 0.01) ///
				stats(N10 N11 N12 N13 N14 N15 N16 N17 N18, layout("@ @ @ @ @ @ @ @ @") labels("Observations") fmt(0)) ///
				mgroups("\multicolumn{8}{c}{\textit{Quantile}}", span) ///
				collabels("10" "20" "30" "40" "50" "60" "70" "80" "90") ///
				ti("Difference in food consumption shares by treatment status at different quantiles (follow-up)\label{QConsFoodFollow}") 
